package ma.cdm.compteRendu.bo;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

/**
 * Responsablepoint entity. @author Limouri Anouar
 */
@Entity
@Table(name = "responsablepoint")
public class Responsablepoint implements java.io.Serializable {

	// Fields

	
	/**
	 * 
	 */
	private static final long serialVersionUID = -346992408482014265L;
	private DetailPoint detailpoint;
	private String typeresponsable;
	private Integer orderresponsable;
    private ResponsablepointId  id;
	// Constructors

	/** default constructor */
	public Responsablepoint() {
	}

	/** full constructor */
	public Responsablepoint(DetailPoint detailpoint, String typeresponsable,
			Integer orderresponsable) {
		this.detailpoint = detailpoint;
		this.typeresponsable = typeresponsable;
		this.orderresponsable = orderresponsable;
	}

	// Property accessors
    @EmbeddedId
    
    @AttributeOverrides( {
        @AttributeOverride(name="idresponsable", column=@Column(name="IDRESPONSABLE", nullable=false) ), 
        @AttributeOverride(name="iddetailpoint", column=@Column(name="IDDETAILPOINT", nullable=false) ) } )
	public ResponsablepointId getId() {
		return id;
	}

	public void setId(ResponsablepointId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "IDDETAILPOINT", nullable=false, insertable=false, updatable=false)
	public DetailPoint getDetailpoint() {
		return this.detailpoint;
	}

	public void setDetailpoint(DetailPoint detailpoint) {
		this.detailpoint = detailpoint;
	}

	@Column(name = "TYPERESPONSABLE", length = 100)
	public String getTyperesponsable() {
		return this.typeresponsable;
	}

	public void setTyperesponsable(String typeresponsable) {
		this.typeresponsable = typeresponsable;
	}

	@Column(name = "ORDERRESPONSABLE")
	public Integer getOrderresponsable() {
		return this.orderresponsable;
	}

	public void setOrderresponsable(Integer orderresponsable) {
		this.orderresponsable = orderresponsable;
	}

}